package com.tanhua.manage.api.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.tanhua.manage.api.AnalysisApi;
import com.tanhua.manage.domain.AnalysisByDay;
import com.tanhua.manage.mapper.AnalysisByDayMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsPackage: com.tanhua.manage.api.impl
 * @Author: 陈延普
 * @CreateTime: 2021-09-19 15:14
 */
@Service
public class AnalysisApiImpl implements AnalysisApi {
    @Autowired
    private AnalysisByDayMapper analysisByDayMapper;

    @Override
    public List<AnalysisByDay> findAnalysisByDayList(String start, String end) {

        QueryWrapper<AnalysisByDay> queryWrapper = new QueryWrapper();
        queryWrapper.le("record_date",end);//小于等于结束时间
        queryWrapper.ge("record_date",start);//大于等于开始时间
        List<AnalysisByDay> analysisByDays = analysisByDayMapper.selectList(queryWrapper);
        return analysisByDays;
    }
}
